package com.situ.util;

import com.situ.water_BE.pojo.BeFormula;
import com.situ.water_BE.pojo.BeHistory;

import java.util.Date;

/**
 * @authot hebing
 * @date 2020/12/8 - 9:36
 */
public class addBe_History {
    /**
     * 添加流程历史
     * @param orderNo 工单号
     * @param stepID  步骤
     * @param sessionId 操作时间
     * @param pd 判断是否撤回
     * @return
     */
    public static BeHistory add(String orderNo,Integer stepID,Integer sessionId,Integer pd){
        BeHistory history=new BeHistory();
        history.setOrderNo(orderNo);
        history.setStepID(stepID);
        history.setDatee(new Date());
        history.setEmpID(sessionId);
        if (pd==0){
            history.setIsBack(false);
        }else {
            history.setIsBack(true);
        }
        return history;
    }
    public static BeFormula addBeFormula(Integer id,String typeCode,String allotText,
                                         Integer allotType,Integer allotValue){
        BeFormula beFormula=new BeFormula();
        beFormula.setOrderUserID(id);
        beFormula.setWaterTypeCode(typeCode);
        beFormula.setAllotText(allotText);
        beFormula.setAllotType(allotType);
        if(allotValue>=0){
            beFormula.setAllotValue(allotValue);
        }
        return beFormula;
    }
}
